package com.xiumiing.net.base.net.util;

/**
 * @author Created by Jeff
 * on 2019/5/27.
 * des:打卡鸭 网络 异常
 */
public class DuckHttpException {

    /**
     * 网络连接异常
     */
    public final static int SOCKET_TIMEOUT_EXCEPTION = -100;
    /**
     * 没有网了，请检查网络是否连接
     */
    public final static int CONNECT_EXCEPTION = -101;
    /**
     * 程序错误，非法参数异常
     */
    public final static int ILLEGAL_ARGUMENT_EXCEPTION = -102;
    /**
     * 未知HOST异常
     */
    public final static int UNKNOWN_HOST_EXCEPTION = -103;
    /**
     * 解析异常
     */
    public final static int PARSE_EXCEPTION = -104;
    /**
     * 未知异常
     */
    public final static int UN_KNOW_EXCEPTION = -199;

    private int errorCode;
    private String errorMsg;
    private Throwable throwable;

    public DuckHttpException(int errorCode, String errorMsg, Throwable throwable) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
        this.throwable = throwable;
    }

    public DuckHttpException() {
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public void setThrowable(Throwable throwable) {
        this.throwable = throwable;
    }
}
